package com.ruoyi.partybuilding.domain;

import com.easy.query.core.annotation.EasyWhereCondition;
import com.easy.query.core.annotation.Navigate;
import com.easy.query.core.annotation.Table;
import com.easy.query.core.enums.RelationTypeEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.partybuilding.common.EQuery.EQueryEntityLong;
import com.ruoyi.partybuilding.common.EQuery.IEQueryEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.*;

import java.util.Date;

/**
 * 党员信息对象 pb_member
 * 
 * @author he-liangliang@outlook.com
 * @date 2024-11-27
 */

@ApiModel(value = "党员信息",description = "")
@Table("pb_member")
@Data
public class Member   extends EQueryEntityLong
{
    private static final long serialVersionUID = 1L;


    /** 姓名 ; */
    @ApiModelProperty(value = "姓名，冗余用户昵称")
    @EasyWhereCondition
    //@Excel(name = "姓名")
    private String name;



    /** 身份证号 ; */
    @ApiModelProperty(value = "身份证号")
    @Excel(name = "身份证号",sort = 3, cellType = Excel.ColumnType.TEXT)
    private String code;



    /** 民族,配置 ; */
    @ApiModelProperty(value = "民族,pb_member_nation")
    @Excel(name = "民族",sort = 5)
    private String nation;

    /** 籍贯，配置 ; */
    @ApiModelProperty(value = "籍贯，配置")
    //@Excel(name = "籍贯，配置")
    private String homeTown;

    /** 出生日期 ; */
    @ApiModelProperty(value = "出生日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "出生日期",sort = 6,dateFormat = "yyyy-MM-dd")
    private Date birth;

    /** 学历 ; */
    @ApiModelProperty(value = "学历,pb_member_education")
    @Excel(name = "学历",sort = 7)
    private String education;

    /** 家庭住址 ; */
    @ApiModelProperty(value = "家庭住址")
    //@Excel(name = "家庭住址")
    private String address;

    /** 工作岗位 ; */
    @ApiModelProperty(value = "工作岗位,pb_member_job")
    private String position;

    /** 是否退休,0未退休，1退休 ; */
    @ApiModelProperty(value = "是否退休,0未退休，1退休")
    //@Excel(name = "是否退休,0未退休，1退休")
    private Long retire;



    /** 照片 ; */
    @ApiModelProperty(value = "照片")
    private String picture;

    /** 系统用户id ; */
    @ApiModelProperty(value = "系统用户id")
    private Long userId;

    @ApiModelProperty(value = "系统用户")
    @Navigate(value = RelationTypeEnum.OneToOne,targetProperty = "userId", selfProperty = "userId")
   private SysUser user;



    /** 党员类型,0预备，1正式 ; */
    @EasyWhereCondition(type = EasyWhereCondition.Condition.EQUAL)
    @ApiModelProperty(value = "党员类别,0预备，1正式")
    @Excel(name = "党员类别",sort = 8,readConverterExp = "0=预备,1=正式")
    private Long memberType;

    /** 入党时间 ; */
    @ApiModelProperty(value = "入党时间")
    @Excel(name = "入党时间",sort = 9,dateFormat = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date memberStart;

    /** 党籍状态,0停止，1正常 ; */
    @EasyWhereCondition
    @ApiModelProperty(value = "党籍状态,0停止，1正常")
    @Excel(name = "党籍状态",sort = 11,readConverterExp = "0=停止,1=正常")
    private Long memberStatus;

    @EasyWhereCondition
    @ApiModelProperty(value = "备注")
    String remark;

    /* 转正时间
     */
    @ApiModelProperty(value = "转正时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "转正时间",sort = 10,dateFormat = "yyyy-MM-dd")
    Date ConfirmationTime;
    /** 履历
     *
     */
    @ApiModelProperty(value = "履历")
    String resume;
    public void toUserSet(SysUser user) {
        user.setNickName(getName());
        user.setRemark(getCode());

    }


    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("name", getName())
            .append("code", getCode())
            .append("nation", getNation())
            .append("homeTown", getHomeTown())
            .append("birth", getBirth())
            .append("education", getEducation())
            .append("address", getAddress())
            .append("position", getPosition())
            .append("retire", getRetire())
            .append("picture", getPicture())
            .append("userId", getUserId())
            .append("memberType", getMemberType())
            .append("memberStart", getMemberStart())
            .append("memberStatus", getMemberStatus())
            .append("remark", getRemark())
            .toString();
    }
}
